Skip to content

feat: Added query mode for skipping incremental segments during query#19545

Open
pirvtech wants to merge 3 commits into
apache:masterfrom
RivianVW-tech:skip-incremental-query
Open

feat: Added query mode for skipping incremental segments during query#19545
pirvtech wants to merge 3 commits into
apache:masterfrom
RivianVW-tech:skip-incremental-query

Conversation

@pirvtech
Copy link
Copy Markdown

@pirvtech pirvtech commented Jun 2, 2026

Description

Querying incremental segments that are being created during streaming ingestion is slower as rows are scanned sequentially. There exists an undocumented feature to skip these segments for query by passing a flag "skipIncrementalSegment" in the query context.

Query context has a documented flag for the query mode on real time segments called "realtimeSegmentsMode" and supports a few modes already. Adding a new mode to skip the incremental segments.

Key changed/added classes in this PR

processing/src/main/java/org/apache/druid/query/QueryContexts.java
server/src/main/java/org/apache/druid/client/CachingClusteredClient.java
server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java

This PR has:

  • [x ] been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity Findings
P0 0
P1 0
P2 1
P3 0
Total 1

Reviewed 4 of 4 changed files.


This is an automated review by Codex GPT-5.5

Comment thread processing/src/main/java/org/apache/druid/query/QueryContexts.java
@pirvtech pirvtech changed the title Added query mode for skipping incremental segments during query feat: Added query mode for skipping incremental segments during query Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants